/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ytmc.uploader;

/**
 *
 * @author K
 */
public enum VideoCategory
{
    FILM("Film", "Film i animacja"),
    AUTOS("Autos", "Motoryzacja"),
    MUSIC("Music", "Muzyka"),
    ANIMALS("Animals", "Zwierzęta"),
    SPORTS("Sports", "Sport"),
    TRAVEL("Travel", "Podróże i wydarzenia"),
    GAMES("Games", "Gry"),
    COMEDY("Comedy", "Śmieszne"),
    PEOPLE("People", "Ludzie i blogi"),
    NEWS("News", "Wiadomości i polityka"),
    ENTERTAINMENT("Entertainment", "Rozrywka"),
    EDUCATION("Education", "Edukacja"),
    HOWTO("Howto", "Poradniki i styl"),
    NONPROFIT("Nonprofit", "Działalność społeczna i non-profit"),
    TECH("Tech", "Nauka i technika");

    private String friendlyName;

    public String getFriendlyName()
    {
        return this.friendlyName;
    }

    private String youTubeName;

    public String getYouTubeName()
    {
        return youTubeName;
    }
    
    VideoCategory(String youTubeName, String friendlyName)
    {
        this.youTubeName = youTubeName;
        this.friendlyName = friendlyName;      
    }
    
    public static VideoCategory fromString(String text)
    {
        if (text != null)
        {
            for (VideoCategory cat : VideoCategory.values())
            {
                if (text.equalsIgnoreCase(cat.getFriendlyName()) || text.equalsIgnoreCase(cat.getYouTubeName()))
                {
                    return cat;
                }
            }
        }

        return null;
    }

}
